import React, {Component} from 'react';

const news = [
    {id: 1, title: 'Hello react!', content: 'Welcome to learning React!'},
    {id: 2, title: 'Installation!', content: 'You can install React from npm.'}
]; 

export default class Key extends Component {
    constructor(props) {
        super(props);
    }

    render() {
        return (
            <div>
                {
                    news.map((item, index) => {
                        return (
                            <div key={item.id}>
                                <h3>{item.title}</h3>
                                <p>{item.content}</p>
                            </div>
                        )
                    })
                }
                <label htmlFor="name">姓名</label>
                <input id="name" />
            </div>
        )
    }
}
